﻿using Domain.Entity;
using Domain.Entity.bs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.IRepository
{
    public interface IProductRepository
    {
        //分页查询货品信息
        Task<FenYe<Product>> GetProduct(FenYe<Product> fenYe,string? name,bool? inventory,int? whid,string? type);

        //添加货品信息
        Task<int> AddProduct(Product product);

        //删除货品信息
        Task<int> DeleteProduct(int id);

        //查询所有货品信息
        Task<List<Product>> GetAllProduct();

        //根据id查询货品信息
        Task<Product> GetProductById(int id);

        //修改货品信息
        Task<int> UpdateProduct(Product product);

        //修改货品信息状态(启用/停用)
        Task<int> UpdateStatus(int procid, int status);

        //分页高级查询
        Task<FenYe<Product>> GetAdvancedProduct(FenYe<Product> fenYe, string? code,string? name,string? typeid,string? model,string? unit,string? startinprice,string? endinprice,string? startoutprice,string? endoutprice,int? is_datamanagement,int? status,int? startwarningdays,int? endwarningdays,int? whid,string? barcode,string? starttime,string? endtime,string? createname);


        //修改货品计划可用库存
        Task<int> Updateky(int id,int inventory);

        //更新货品总库存与总金额（入库）
        Task<int> Updateinventory(Product product);


        //更新货品总库存与总金额(出库)
        Task<int> UpdateinventoryJian(Product product);

        // 分页查询货品信息（通过货品ID数组）
        Task<FenYe<Product>> GetProductsByIds(FenYe<Product> fenYe, int[] proc_id, string? proc_code = null, string? proc_primary_unit = null);

        //根据货品id批量获取
        Task<List<Product>> GetProductsByIds(int[] proc_ids);
    }
}
